<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>获取可视窗口的尺寸</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        html, body{
            width: 2000px;
            height: 3000px;
        }
    </style>
</head>
<body>
    <script>
        /*
        加上了滚动条
        */
         console.log(window.innerWidth, window.innerHeight); // 浏览器可视窗口的宽度  浏览器可视窗口的高度
         /*
         不算滚动条
         */
         console.log('宽度', document.documentElement.clientWidth)   
         console.log('高度', document.documentElement.clientHeight)   
    </script>
</body>
</html>